/* GUI CONVERTED from recwoup.p (converter v1.75) Sat Aug 12 23:05:25 2000 */
/* recwoup.p - CUMULATIVE WORK ORDER DELETE/ARCHIVE DRIVER                   */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                       */
/* All rights reserved worldwide.  This is an unpublished work.              */
/*F0PN*/ /*V8:ConvertMode=Report                                             */
/*K1Q4*/ /*V8:RunMode=Character,Windows                                      */
/* REVISION: 8.5            CREATED: 05/09/96   BY: *G1S6* Julie Milligan    */
/* REVISION: 8.5      LAST MODIFIED: 07/26/96   BY: *J10X* Markus Barone     */


/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane         */
/* REVISION: 8.6E     LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan        */
/* REVISION: 8.6E     LAST MODIFIED: 08/05/98   BY: *J2TR* Santhosh Nair     */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan        */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00 BY: *N0KP* myb                 */

/*THIS PROGRAM WAS COPIED FROM WOWOUP.P                                      */


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

         {mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE recwoup_p_1 "Archive"
/* MaxLen: Comment: */

&SCOPED-DEFINE recwoup_p_2 "Archive File"
/* MaxLen: Comment: */

&SCOPED-DEFINE recwoup_p_3 "Delete"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

         /* Begin added block */
         define new shared variable nbr like wo_nbr.
         define new shared variable nbr1 like wo_nbr.
         define new shared variable lot like wo_lot.
         define new shared variable lot1 like wo_lot.
         define new shared variable part like wo_part.
         define new shared variable part1 like wo_part.
         define new shared variable rel like wo_rel_date.
         define new shared variable rel1 like wo_rel_date.
         define new shared variable due like wo_due_date.
         define new shared variable due1 like wo_due_date.
         define new shared variable so_job like wo_so_job.
         define new shared variable so_job1 like wo_so_job.
         define new shared variable proj like wo_project.
         define new shared variable vend like wo_vend.
         define new shared variable rdelete like mfc_logical label {&recwoup_p_3}.
         define new shared variable archive like mfc_logical
                label {&recwoup_p_1} initial yes.
         define new shared variable filename as character format "x(12)"
                label {&recwoup_p_2}.
         /* End added block */

/*J10X*/ if can-find(first qad_wkfl where qad_key1 = "WO-CLOSE") then do:
/*J10X*/    {mfmsg.i 1361 1}
/*J10X*/    /* OLD WORK ORDER DATA STORAGE HAS BEEN DETECTED IN QAD_WKFL */
/*J10X*/    {mfmsg.i 1362 1}
/*J10X*/    /* PLEASE RUN "UTQADWO.P" BEFORE EXECUTING THIS FUNCTION     */
/*J10X*/    pause.
/*J10X*/    hide message no-pause.
/*J10X*/    return.
/*J10X*/ end.

         /* DISPLAY SELECTION FORM */

         
/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
            
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
nbr            colon 15
            nbr1           label {t001.i} colon 49 skip
            lot            colon 15
            lot1           label {t001.i} colon 49 skip
            part           colon 15
            part1          label {t001.i} colon 49 skip
            skip(1)
            rel            colon 15
            rel1           label {t001.i} colon 49 skip
            due            colon 15
            due1           label {t001.i} colon 49 skip
            so_job         colon 15
            so_job1        label {t001.i} colon 49 skip (1)
            proj           colon 15 skip
            vend           colon 15 skip
            skip (1)
            rdelete        colon 15
            archive        colon 15
            filename       colon 15
         with frame a side-labels width  80 NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:HIDDEN in frame a = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5.  /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



         /* SET EXTERNAL LABELS */
         setFrameLabels(frame a:handle).

         repeat:
            if nbr1 = hi_char then nbr1 = "".
            if lot1 = hi_char then lot1 = "".
            if part1 = hi_char then part1 = "".

            update nbr nbr1 lot lot1 part part1
            rel rel1 due due1 so_job so_job1 proj vend
            rdelete archive
            with frame a.

            if archive then do:

/*J2TR*/  /*  FILE NAME CREATION  IS CHANGED. GENERATED  FILE NAME   IS       */
/*J2TR*/  /*  INDEPENDENT  OF PROGRESS -D PARAMETER  AND  UNIFORM IN ALL      */
/*J2TR*/  /*  OTHER PROGRAMS  .                                               */

/*J2TR**       filename = string(today,"999999").
 *             filename = "wo" + substring(filename,5,2)
 *             + substring(filename,1,2) + substring(filename,3,2).
 *             filename = filename + ".hst".
 *J2TR**/

/*J2TR*/       filename = "wo"
/*J2TR*/          + substring(string(year(today),"9999"),3,2)
/*J2TR*/          + string(month(today),"99")
/*J2TR*/          + string(day(today),"99")
/*J2TR*/          + ".hst".

               display filename with frame a.
               {mfmsg.i 51 1}
               /*Note: archive files should be backed up and deleted from disk*/
               if search(filename) <> ? then do:
                  {mfmsg03.i 52 2 filename """" """"}
                 /* WARNING: <filename> exists, archive data will be appended */
               end.
            end.
            else do:
               display "" @ filename with frame a.
            end.

            if nbr1 = "" then nbr1 = hi_char.
            if lot1 = "" then lot1 = hi_char.
            if part1 = "" then part1 = hi_char.

            /* SELECT PRINTER */
            {mfselprt.i "printer" 132}
/*GUI*/ RECT-FRAME:HEIGHT-PIXELS in frame a = FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.

            {mfphead.i}
            {gprun.i ""recwoup1.p""}

            {mftrl080.i}
         end.  /* repeat */
